-
Notifications
You must be signed in to change notification settings - Fork 199
Enhancement - Introduce pvcName input param in CNSUnregisterVolume #3658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kolluria The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/assign @kolluria |
c642957
to
1a5b942
Compare
1a5b942
to
feec22b
Compare
/ok-to-test |
ok-to-test-wcp |
ok-to-test-tkg |
feec22b
to
395d870
Compare
Triggering CSI-TKG Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
Triggering CSI-WCP Pre-checkin Pipeline for this PR... Job takes approximately an hour to complete |
395d870
to
8570708
Compare
/retest-required |
…spec Adds validation rules using x-kubernetes-validations to ensure that only one of the volumeID or pvcName is specified to avoid ambiguity. Updates the reconciler to use the informer cache to find out the PV and VolumeID when the PVC Name is supplied. Optimises the reconciler logic to ignore all such events that do not increment the generation. Optimises the usage calculation logic by failing fast when usages are detected. Updates the reconciler to add a finalizer to the CR before reconciling to have control over deletion process Updates the reconciler to process the delete events and remove the finalizer for graceful deletion. Updates the reconciler to protect the PVC using a finalizer to gracefully reconciler in case of retries Removes the code that retains the persistent volume as it's no longer required Updates the reconciler to remove the finalizer on the PVC once unregistration is successful for graceful deletion of the PVC. Adds/updates unit tests wherever necessary and applicable.
8570708
to
28da214
Compare
|
|
What this PR does / why we need it
pvcName
as part of the CNS Unregister Volume spec. As the users are inclined to refer to the volumes using the PVCs rather than the volume handles, this would improve the UX.x-kubernetes-validations
to ensure that only one of thevolumeID
orpvcName
is specified to avoid ambiguity.Testing done
Input Validation
When input is invalid
Result: CR admission was rejected with the expected errors -
Workflow validation
vol-used-by-pod
,vol-used-by-vm
andvol-unused
vol-unused
with the Volume IDvol-used-by-pod
with the PVC Namevol-used-by-vm
with the PVC Name andforceUnregister
set to trueInput
Output
Observations:
vol-used-by-pod
failed with appropriate error -vol-used-by-vm
succeeded due to application of force and the PVC/PV are in terminating state(it will be garbage collected once the VM is deleted) -vol-unused
was successful.Special notes for your reviewer:
Release note: